import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:industry_net/base/common/colors_util.dart';
import 'package:industry_net/base/common/img_util.dart';
import 'package:industry_net/base/common/size_fit.dart';
import 'package:industry_net/base/common/text_util.dart';

class GoodsCell extends StatelessWidget {
  const GoodsCell({Key? key, required this.index}) : super(key: key);
  final int index;
  @override
  Widget build(BuildContext context) {
    return ClipRRect(
      borderRadius: BorderRadius.circular(circle4),
      child: Container(
        color: ColorsUtil.white,
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            loadImage(height: 165.w),
            Padding(
                padding: EdgeInsets.fromLTRB(gap12, 5.w, gap12, 0),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text.rich(TextSpan(children: [
                      WidgetSpan(
                          child: Container(
                        padding: EdgeInsets.symmetric(horizontal: 3.w),
                        decoration: BoxDecoration(
                            color: ColorsUtil.orange,
                            borderRadius: BorderRadius.circular(2.w)),
                        child: Text(
                          '推荐',
                          style: pfMediumStyle(
                              color: Colors.white, fontSize: font12),
                        ),
                      )),
                      WidgetSpan(
                          child: SizedBox(
                        width: 3.w,
                      )),
                      TextSpan(
                          text: '砀山特产新鲜糖水黄桃水果罐头',
                          style: pfSCStyle(
                              color: ColorsUtil.title, fontSize: font14))
                    ])),
                    Text(
                      '超过10万用户好评',
                      style: pfMediumStyle(
                          color: const Color(0xffb4a387), fontSize: font12),
                    ),
                    Text.rich(TextSpan(
                        text: '￥',
                        style: pfMediumStyle(
                            color: const Color(0xfff65436), fontSize: font10),
                        children: [
                          TextSpan(
                              text: '50.5',
                              style: pfSCStyle(
                                  color: const Color(0xfff65436),
                                  fontSize: font17))
                        ]))
                  ],
                ))
          ],
        ),
      ),
    );
  }
}
